function ft = FittingModel(varargin)
%FITTINGMODEL Summary of this function goes here
%   Detailed explanation goes here
    expected_modelName={'Lorentz','Gaussian','PseudoVoigt','SqrtLorentz','SqrtLorentz2'};
    p=inputParser;
    p.addParameter('modelName', 'SqrtLorentz', @(x) any(validatestring(x, expected_modelName)));
    p.parse(varargin{:});

    switch p.Results.modelName
        case 'Lorentz'
            ft=fittype('a*gamma/(pi*((w-w0)^2+gamma^2))+b', 'indep', 'w');
        case 'Gaussian'
            ft=fittype('a*exp(-(w-w0)^2/(2*sigma^2))/(sqrt(2*pi)*sigma)+b', 'indep', 'w');
        case 'PseudoVoigt'
            ft=fittype('a*( eta*gamma/(pi*((w-w0)^2+gamma^2))+(1-eta)*exp(-(w-w0)^2/(2*sigma^2))/(sqrt(2*pi)*sigma) )+b', 'indep', 'w');
        case 'SqrtLorentz'
            ft=fittype('a*gamma/sqrt(pi*((w-w0)^2+gamma^2))+b', 'indep', 'w');
        case 'SqrtLorentz2'
            ft=fittype('a*gamma131/sqrt(pi*((w-w0_131)^2+gamma131^2))+b*gamma129/sqrt(pi*((w-w0_129)^2+gamma129^2))+c', 'indep', 'w');
    end
end

